A primary function of brokerage firms is to conduct trades on behalf of clients. From an information flow perspective, trading at a brokerage firm includes steps of collecting orders from clients to buy or sell various financial products and placing these orders on a specified stock exchange. Each client may have multiple brokerage accounts open at a brokerage firm so the trading must specify which account a trade is associated with. Once an order is placed, it may be executed (e.g., by the selected stock exchange's matching engine). The executions are captured by the brokerage firm's trading system and the executed quantities from each financial product must be allocated fairly on the client's accounts. That is, they must be allocated based on the ordered quantity per account (as specified by the client at the time of placing the order).
Some orders may be fully executed, while others may be partially executed or not executed at all. If the entire ordered quantity it is executed (fully or partially) at a unique price, then allocation is straightforward—the executed quantity will be allocated on the client's accounts proportionate to the quantity demanded by the client in each of its accounts.
However, often there is a price breakdown associated with an order. That is, the total ordered quantity is fully or partially executed at multiple prices. Such situations give rise to an integer allocation problem that requires optimization. Pursuant to some embodiments, an optimization algorithm is provided to achieve an average price per account as close as possible to each other (and to the overall weighted average price), with respect to the initial demanded quantity per account.
The problem is exacerbated because, in general, no satisfactory polynomial algorithm has been discovered that can be used in integer linear programming. Generally, the practical experience shows that large-scale integer linear programs seem as yet practically unsolvable or extremely time-consuming. The algorithm and embodiments described herein provide an alternative approach to the problem and provide desirable results.